package model;

public class Treasure {
    private Goods goods;

    private int num;

    public Treasure(Goods goods, int num) {
        this.goods = goods;
        this.num = num;
    }

    public double getSum(){
        return goods.getPrice() * num;
    }

    public Goods getGoods() {
        return goods;
    }

    public int getNum() {
        return num;
    }

    public String toString(){
        return  goods.getGoodsName() + "\t" + goods.getPrice() + "\t" + num + "\t" + getSum();
    }
}

